Optimal. Leaf size=49 \[ -\frac {\sin (c+d x) \cos (c+d x) (a+b \tan (c+d x))}{2 d}+\frac {a x}{2}-\frac {b \log (\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {819, 635, 203, 260} \[ -\frac {\sin (c+d x) \cos (c+d x) (a+b \tan (c+d x))}{2 d}+\frac {a x}{2}-\frac {b \log (\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 635
Rule 819
Rubi steps
\begin {align*} \int \sin ^2(c+d x) (a+b \tan (c+d x)) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 (a+b x)}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d}+\frac {\operatorname {Subst}\left (\int \frac {a+2 b x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac {\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d}+\frac {a \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {b \operatorname {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {a x}{2}-\frac {b \log (\cos (c+d x))}{d}-\frac {\cos (c+d x) \sin (c+d x) (a+b \tan (c+d x))}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 56, normalized size = 1.14 \[ \frac {a (c+d x)}{2 d}-\frac {a \sin (2 (c+d x))}{4 d}-\frac {b \left (\log (\cos (c+d x))-\frac {1}{2} \cos ^2(c+d x)\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.54, size = 47, normalized size = 0.96 \[ \frac {a d x + b \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, b \log \left (-\cos \left (d x + c\right )\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.54, size = 413, normalized size = 8.43 \[ \frac {2 \, a d x \tan \left (d x\right )^{2} \tan \relax (c)^{2} - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \relax (c)^{2} + 2 \, a d x \tan \left (d x\right )^{2} + 2 \, a d x \tan \relax (c)^{2} + b \tan \left (d x\right )^{2} \tan \relax (c)^{2} - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \left (d x\right )^{2} + 2 \, a \tan \left (d x\right )^{2} \tan \relax (c) - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \relax (c)^{2} + 2 \, a \tan \left (d x\right ) \tan \relax (c)^{2} + 2 \, a d x - b \tan \left (d x\right )^{2} - 4 \, b \tan \left (d x\right ) \tan \relax (c) - b \tan \relax (c)^{2} - 2 \, b \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) - 2 \, a \tan \left (d x\right ) - 2 \, a \tan \relax (c) + b}{4 \, {\left (d \tan \left (d x\right )^{2} \tan \relax (c)^{2} + d \tan \left (d x\right )^{2} + d \tan \relax (c)^{2} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.18, size = 58, normalized size = 1.18 \[ -\frac {a \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {a x}{2}+\frac {c a}{2 d}-\frac {b \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {b \ln \left (\cos \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.57, size = 52, normalized size = 1.06 \[ \frac {{\left (d x + c\right )} a + b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac {a \tan \left (d x + c\right ) - b}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.82, size = 50, normalized size = 1.02 \[ \frac {\frac {b\,{\cos \left (c+d\,x\right )}^2}{2}-\frac {a\,\sin \left (c+d\,x\right )\,\cos \left (c+d\,x\right )}{2}+\frac {b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2}+\frac {a\,d\,x}{2}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan {\left (c + d x \right )}\right ) \sin ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________